package com.novel.frame.lgw;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.WindowConstants;

import com.novel.frame.lxf.Login_Panel;
import com.novel.frame.lxf.Register_Jpanel;
import com.novel.frame.yf.Person_center;

/**
    * 公告资讯界面
 * @author Administrator
 *
 */
public class Notice extends JFrame{
	private static final long serialVersionUID = 1L;
	private JScrollPane js_MainScreen;// 主滚动面板
	private JPanel jp_MainScreen;// 主面板
	private JPanel jp_NoticeSouth;//南部
	private JPanel jp_NoticeNorth;//北部
	private JPanel jp_NoticeNorth_nor;//北部===北面
	private JLabel jl_NoticeNor_register;//注册
	private JLabel jl_NoticeNor_logOn;//登录
	private JLabel jl_NoticeNor_helpOne;//帮助
	private JLabel jl_NoticeNor_Client;//客户端
	private JLabel jl_NoticeNor_Collection;//收藏
	private JLabel jl_NoticeNor_homePage;//首页
	private JLabel jl_NoticeNor_helpTwo;//帮助
	
	private JPanel jp_NoticeNorth_cer;//北部===中间
	private JLabel jl_NoticeCer_logn;//logn标签
	private JLabel jl_NoticeCer_Romance;//转言情网标签
	private JLabel jl_NoticeCer_literature;//转文学网标签
	private JLabel jl_NoticeCer_Comic;//转动漫网标签
    private JLabel jl_NoticeCer_Recommendnovel;//推荐小说标签
    private JLabel jl_NoticeCer_Noticedisplay;//推荐小说标签

	private JPanel jp_NoticeNorth_sth;//北部===南面	
	private JPanel jp_NoticeSth_menu;//菜单面板
	private JButton jb_NoticeSth_homePage;//首页
	private JButton jb_NoticeSth_girlChannel;//女生频道
	private JButton jb_NoticeSth_RankList;//排行版
	private JButton jb_NoticeSth_query;//查询小说
	private JButton jb_NoticeSth_authorWelfare;//作者福利
	private JButton jb_NoticeSth_authorArea;//作者专区
	private JButton jb_NoticeSth_Notice;//资讯
	private JButton jb_NoticeSth_Client;//客户端
	private JButton jb_NoticeSth_Recharge;//充值
	private JButton jb_NoticeSth_CustomerService;//客服
	private JLabel  jl_NoticeSth_StackRoom;//书库标签
	private JLabel  jl_NoticeSth_urbanAndRomance;//都市-言情
	private JLabel  jl_NoticeSth_fantasy;//玄幻-修真
	private JLabel  jl_NoticeSth_history;//历史-武侠
	private JLabel  jl_NoticeSth_sports;//网游-竞技
	private JLabel  jl_NoticeSth_military;//军事-科幻
	private JLabel  jl_NoticeSth_terror;//恐怖-同人
	private JLabel  jl_NoticeSth_newBook;//全本-新书
		
	private JPanel jp_NoticeCenter;//中部
	
	private JTextField jt_NoticeCenter_search;//搜索框
	private JButton jb_NoticeCenter_search;//搜索按钮
	private JPanel jp_NoticeCenter_total;//中部展示面板
	private JPanel jp_NoticeCenter_display;//中部展示面板
	private JLabel jl_NoticeCenter_Notice;//公告
	private ImageIcon im_NoticeOne;//展示图片
	
	private JPanel jp_NoticeCenter_change;//中部切换面板
	private JLabel jl_NoticeCenter_totalMag;//总共信息标签
	private JButton jb_NoticeCenter_changeOne;//切换一
	private JButton jb_NoticeCenter_changeTwo;//切换二
	private JButton jb_NoticeCenter_changeThree;//切换三
	private JButton jb_NoticeCenter_totalchange;//总共切换
    
	
//	private JPanel jp_NoticeCenter_Recommend;//推荐小说面板
	
	Cursor cursor=new Cursor(Cursor.HAND_CURSOR);//小手
	public Notice(String username,boolean flag) {
		Dimension d = getToolkit().getScreenSize();
        setLayout(null);
		//主滚动面板
        js_MainScreen = new JScrollPane();
		js_MainScreen.setBounds(0, 0, d.width, d.height);
		js_MainScreen.getVerticalScrollBar().setUnitIncrement(20);
		add(js_MainScreen);
	    // 创建主面板
		jp_MainScreen = new JPanel();
		jp_MainScreen.setPreferredSize(new Dimension(d.width, (int)(2.4*d.height)));
		jp_MainScreen.setBackground(Color.WHITE);
		jp_MainScreen.setLayout(new BorderLayout());
		js_MainScreen.getViewport().add(jp_MainScreen);
		//北部面板
		jp_NoticeNorth=new JPanel();
		jp_NoticeNorth.setPreferredSize(new Dimension(0, (int)(d.height*0.28)));
		jp_NoticeNorth.setLayout(new BorderLayout());
		jp_MainScreen.add(jp_NoticeNorth, BorderLayout.NORTH);
        //北部=的北面
		jp_NoticeNorth_nor=new JPanel();
		jp_NoticeNorth_nor.setBackground(new Color(210, 210, 210));
		jp_NoticeNorth_nor.setPreferredSize(new Dimension(0,(int)((d.height*0.28)*0.16)));
		jp_NoticeNorth_nor.setLayout(null);
		jp_NoticeNorth.add(jp_NoticeNorth_nor, BorderLayout.NORTH);
		NoticeNorth_nor(d,username, flag);//北部面板标签===方法		
		//北部===的中间
		jp_NoticeNorth_cer=new JPanel();
		jp_NoticeNorth_cer.setBackground(new Color(245, 245, 245));
		jp_NoticeNorth_cer.setPreferredSize(new Dimension(0,(int)((d.height*0.28)*0.54)));
		jp_NoticeNorth_cer.setLayout(null);
		jp_NoticeNorth.add(jp_NoticeNorth_cer, BorderLayout.CENTER);
		NoticeNorth_cer(d);
		//北部===的南
		jp_NoticeNorth_sth=new JPanel();
		jp_NoticeNorth_sth.setBackground(new Color(0,160,178));
		jp_NoticeNorth_sth.setPreferredSize(new Dimension(0,(int)((d.height*0.28)*0.30)));
		jp_NoticeNorth_sth.setLayout(null);
		jp_NoticeNorth.add(jp_NoticeNorth_sth, BorderLayout.SOUTH);
		NoticeNorth_sth(d,username,flag);	
        
		//中部
		jp_NoticeCenter=new JPanel();
		jp_NoticeCenter.setLayout(null);
		jp_MainScreen.add(jp_NoticeCenter, BorderLayout.CENTER);
		NoticeCenter(d);
		
		//南部
		ImageIcon im_NoticeSonth=new ImageIcon(Notice.class.getResource("公告底部.png"));
		jp_NoticeSouth=new JPanel() {
			private static final long serialVersionUID = 1L;
			@Override
			public void paint(Graphics g) {
                  Image i=im_NoticeSonth.getImage();
                  g.drawImage(i, 0,0,this);
			}
		};
		jp_NoticeSouth.setPreferredSize(new Dimension(im_NoticeSonth.getIconWidth(),
				im_NoticeSonth.getIconHeight()));
		jp_MainScreen.add(jp_NoticeSouth, BorderLayout.SOUTH);
		
        setTitle("公告资讯");
		setSize(d);
		setLocationRelativeTo(null);
		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		setVisible(true);	
	}

	//北部===北面(绝对布局)
	public void NoticeNorth_nor(Dimension d,String username,boolean flag) {
	 Font font=new Font("微软雅黑", Font.PLAIN, 12);//字体格式
	 int NoticeNorHight=(int)(((d.height*0.25)*0.16)*0.05);//在面板标签==高度
	  //注册标签
	  jl_NoticeNor_register=new JLabel("");
	  if (flag) {
		  jl_NoticeNor_register.setText(username);
		  jl_NoticeNor_register.addMouseListener(new MouseAdapter() {
			       @Override
			    public void mouseClicked(MouseEvent e) {
			    	   new Person_center(username, flag);
			    }
			});
	   }else {
		   jl_NoticeNor_register.setText("注册");
		   jl_NoticeNor_register.addMouseListener(new MouseAdapter() {
		       @Override
		    public void mouseClicked(MouseEvent e) {
		    	   new Register_Jpanel();
		    }
		});
	   }
	  jl_NoticeNor_register.setBounds((int)(d.width*0.12),NoticeNorHight,40, 30);	  
	  jl_NoticeNor_register.setFont(font);
	  jl_NoticeNor_register.setCursor(cursor);  
	  jp_NoticeNorth_nor.add(jl_NoticeNor_register);
	  //分割==1
	  JLabel jl_DivisionOne=new JLabel("|");
	  jl_DivisionOne.setBounds((int)(d.width*0.12)+40,-5,20,40);
	  jp_NoticeNorth_nor.add(jl_DivisionOne);
	  //登录标签
	  jl_NoticeNor_logOn=new JLabel("");
	  if (flag) {
		  jl_NoticeNor_logOn.setText("退出");
		  jl_NoticeNor_logOn.addMouseListener(new MouseAdapter() {
			       @Override
			    public void mouseClicked(MouseEvent e) {
			          new Notice("", false);
			          dispose();
			    }
			});
	    }else {
	     jl_NoticeNor_logOn.setText("登陆");
	     jl_NoticeNor_logOn.addMouseListener(new MouseAdapter() {
		       @Override
		    public void mouseClicked(MouseEvent e) {
		    	   new Login_Panel();
		    	   dispose();
		    }
		});
	    }
	  jl_NoticeNor_logOn.setBounds((int)(d.width*0.12)+40+20,NoticeNorHight,40, 30);
	  jl_NoticeNor_logOn.setFont(font);
	  jl_NoticeNor_logOn.setCursor(cursor);
	  jp_NoticeNorth_nor.add(jl_NoticeNor_logOn);
	  //分割==2
	  JLabel jl_DivisionTwo=new JLabel("|");
	  jl_DivisionTwo.setBounds((int)(d.width*0.12)+40+20+40,-5,20,40);
	  jp_NoticeNorth_nor.add(jl_DivisionTwo);
	  //帮助==1
	  jl_NoticeNor_helpOne=new JLabel("帮助");
	  jl_NoticeNor_helpOne.setBounds((int)(d.width*0.12)+40+20+40+20,NoticeNorHight,40, 30);
	  jl_NoticeNor_helpOne.setFont(font);
	  jl_NoticeNor_helpOne.setCursor(cursor);
	  jp_NoticeNorth_nor.add(jl_NoticeNor_helpOne);
	  //分割==3
	  JLabel jl_DivisionThree=new JLabel("|");
	  jl_DivisionThree.setBounds((int)(d.width*0.12)+40+20+40+20+40,-5,20,40);
	  jp_NoticeNorth_nor.add(jl_DivisionThree);
	  //客户端
	  jl_NoticeNor_Client=new JLabel("客户端");
	  jl_NoticeNor_Client.setBounds((int)(d.width*0.12)+40+20+40+20+40+20,NoticeNorHight,40, 30);
	  jl_NoticeNor_Client.setFont(font);
	  jl_NoticeNor_Client.setCursor(cursor);
	  jp_NoticeNorth_nor.add(jl_NoticeNor_Client);
	  
	  //设为收藏
	  jl_NoticeNor_Collection=new JLabel("设为收藏");
	  jl_NoticeNor_Collection.setBounds((int)(d.width*0.8),NoticeNorHight,60,30);
	  jl_NoticeNor_Collection.setFont(font);
	  jl_NoticeNor_Collection.setCursor(cursor);
	  jp_NoticeNorth_nor.add(jl_NoticeNor_Collection);
	  //分割==4
	  JLabel jl_Divisionfour=new JLabel("|");
	  jl_Divisionfour.setBounds((int)(d.width*0.8)+60,-5,20,40);
	  jp_NoticeNorth_nor.add(jl_Divisionfour);
	  //设为首页
	  jl_NoticeNor_homePage=new JLabel("设为首页");
	  jl_NoticeNor_homePage.setBounds((int)(d.width*0.8)+60+20,NoticeNorHight,60,30);
	  jl_NoticeNor_homePage.setFont(font);
	  jl_NoticeNor_homePage.setCursor(cursor);
	  jp_NoticeNorth_nor.add(jl_NoticeNor_homePage);
	  //分割==5
	  JLabel jl_Divisionfive=new JLabel("|");
	  jl_Divisionfive.setBounds((int)(d.width*0.8)+60+20+60,-5,20,40);
	  jp_NoticeNorth_nor.add(jl_Divisionfive);
	  //帮助
	  jl_NoticeNor_helpTwo=new JLabel("帮助");
	  jl_NoticeNor_helpTwo.setBounds((int)(d.width*0.8)+60+20+60+20,NoticeNorHight,40,30);
	  jl_NoticeNor_helpTwo.setFont(font);
	  jl_NoticeNor_helpTwo.setCursor(cursor);
	  jp_NoticeNorth_nor.add(jl_NoticeNor_helpTwo);
	}
	//北部===中间(绝对布局)
	public void NoticeNorth_cer(Dimension d) {
		Font font=new Font("微软雅黑", Font.PLAIN, 15);//字体格式
		int NoticeCerHight=(int)((d.height*0.25)*0.58);
	  //logn书海
	  ImageIcon  NoticeCer_logn=new ImageIcon(Notice.class.getResource("NoticeLogn.png"));
	  jl_NoticeCer_logn=new JLabel();
	  jl_NoticeCer_logn.setIcon(NoticeCer_logn);
	  jl_NoticeCer_logn.setBounds((int)(d.width*0.12),(int)(NoticeCerHight*0.052),NoticeCer_logn.getIconWidth(),
			  NoticeCer_logn.getIconHeight());
	  jl_NoticeCer_logn.setCursor(cursor);
	  jp_NoticeNorth_cer.add(jl_NoticeCer_logn);
	  //言情网标签
	  jl_NoticeCer_Romance=new JLabel("┠ 言情网");
	  jl_NoticeCer_Romance.setBounds((int)(d.width*0.1175)+NoticeCer_logn.getIconWidth(),
			  (int)(NoticeCerHight*0.14),80, 30); 
	  jl_NoticeCer_Romance.setCursor(cursor);
	  jl_NoticeCer_Romance.setFont(font);
	  jp_NoticeNorth_cer.add(jl_NoticeCer_Romance);
	  //文学网标签
	  jl_NoticeCer_literature=new JLabel("┠ 文学网");
	  jl_NoticeCer_literature.setBounds((int)(d.width*0.1175)+NoticeCer_logn.getIconWidth(),
			  (int)(NoticeCerHight*0.38),80, 30); 
	  jl_NoticeCer_literature.setCursor(cursor);
	  jl_NoticeCer_literature.setFont(font);
	  jp_NoticeNorth_cer.add(jl_NoticeCer_literature);
	  //言情网标签
	  jl_NoticeCer_Comic=new JLabel("┠ 动漫网");
	  jl_NoticeCer_Comic.setBounds((int)(d.width*0.1175)+NoticeCer_logn.getIconWidth(),
			  (int)(NoticeCerHight*0.62),80, 30); 
	  jl_NoticeCer_Comic.setCursor(cursor);
	  jl_NoticeCer_Comic.setFont(font);
	  jp_NoticeNorth_cer.add(jl_NoticeCer_Comic);
	  //推荐小说标签
	  ImageIcon im_NoticeCer_Recommendnovel=new ImageIcon(Notice.class.getResource("推荐小说.jpg"));
	  jl_NoticeCer_Recommendnovel=new JLabel();
	  jl_NoticeCer_Recommendnovel.setIcon(im_NoticeCer_Recommendnovel);
	  jl_NoticeCer_Recommendnovel.setBounds((int)(d.width*0.18)+NoticeCer_logn.getIconWidth(),
			  (int)(NoticeCerHight*0.14),im_NoticeCer_Recommendnovel.getIconWidth(),im_NoticeCer_Recommendnovel.getIconHeight()); 
	  jl_NoticeCer_Recommendnovel.setCursor(cursor);
	  jp_NoticeNorth_cer.add(jl_NoticeCer_Recommendnovel);
	  //公告展示
	  ImageIcon im_NoticeCer_Noticedisplay=new ImageIcon(Notice.class.getResource("公告paint.png"));
	  jl_NoticeCer_Noticedisplay=new JLabel();
	  jl_NoticeCer_Noticedisplay.setIcon(im_NoticeCer_Noticedisplay);
	  jl_NoticeCer_Noticedisplay.setBounds((int)(d.width*0.20 )+NoticeCer_logn.getIconWidth()+
			  im_NoticeCer_Recommendnovel.getIconWidth(),(int)(NoticeCerHight*0.07),
			  im_NoticeCer_Noticedisplay.getIconWidth(),
			  im_NoticeCer_Noticedisplay.getIconHeight()); 
	  jl_NoticeCer_Noticedisplay.setCursor(cursor);
	  jp_NoticeNorth_cer.add(jl_NoticeCer_Noticedisplay);  
	}
	//北部===南面(绝对布局)
	public void NoticeNorth_sth(Dimension d,String username,boolean flag ) {
    	int NoticeSthHight=(int)((d.height*0.28)*0.30);//面板高
    	Font font=new Font("宋体",Font.PLAIN, 16);
    	//菜单面板
    	jp_NoticeSth_menu=new JPanel();
    	jp_NoticeSth_menu.setBounds(0, 3,d.width,(int)(NoticeSthHight*0.55));
    	jp_NoticeSth_menu.setLayout(null);
    	jp_NoticeNorth_sth.add(jp_NoticeSth_menu);
    	//首页
    	jb_NoticeSth_homePage=new JButton("首页");
    	jb_NoticeSth_homePage.setBounds((int)(d.width*0.12),-2,(int)(d.width*0.07), 40);
    	jb_NoticeSth_homePage.setFont(font);
    	jb_NoticeSth_homePage.setFocusable(false);
    	jb_NoticeSth_homePage.setCursor(cursor);
    	jb_NoticeSth_homePage.setBackground(new Color(0,160,178));
    	jp_NoticeSth_menu.add(jb_NoticeSth_homePage);
    	//女生频道
    	jb_NoticeSth_girlChannel=new JButton("女生频道");
    	jb_NoticeSth_girlChannel.setBounds((int)(d.width*0.12)+(int)(d.width*0.07),-2,(int)(d.width*0.07), 40);
    	jb_NoticeSth_girlChannel.setFont(font);
    	jb_NoticeSth_girlChannel.setFocusable(false);
    	jb_NoticeSth_girlChannel.setCursor(cursor);
//    	jb_NoticeSth_girlChannel.setBackground(new Color(0,160,178));
    	jp_NoticeSth_menu.add(jb_NoticeSth_girlChannel);
    	//排行榜
    	jb_NoticeSth_RankList=new JButton("排行榜");
    	jb_NoticeSth_RankList.setBounds((int)(d.width*0.12)+(int)(d.width*0.07)+(int)(d.width*0.07),-2,(int)(d.width*0.07), 40);
    	jb_NoticeSth_RankList.setFont(font);
    	jb_NoticeSth_RankList.setFocusable(false);
    	jb_NoticeSth_RankList.setCursor(cursor);
//    	jb_NoticeSth_girlRankList.setBackground(new Color(0,160,178));
    	jp_NoticeSth_menu.add(jb_NoticeSth_RankList);
    	//搜小说
    	jb_NoticeSth_query=new JButton("搜小说");
    	jb_NoticeSth_query.setBounds((int)(d.width*0.12)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07),-2,(int)(d.width*0.07), 40);
    	jb_NoticeSth_query.setFont(font);
    	jb_NoticeSth_query.setFocusable(false);
    	jb_NoticeSth_query.setCursor(cursor);
//    	jb_NoticeSth_query.setBackground(new Color(0,160,178));
    	jp_NoticeSth_menu.add(jb_NoticeSth_query);
    	//作者福利
    	jb_NoticeSth_authorWelfare=new JButton("作者福利");
    	jb_NoticeSth_authorWelfare.setBounds((int)(d.width*0.12)+(int)(d.width*0.07)
    			+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07),-2,
    			(int)(d.width*0.07), 40);
    	jb_NoticeSth_authorWelfare.setFont(font);
    	jb_NoticeSth_authorWelfare.setFocusable(false);
    	jb_NoticeSth_authorWelfare.setCursor(cursor);
//    	jb_NoticeSth_authorWelfare.setBackground(new Color(0,160,178));
    	jp_NoticeSth_menu.add(jb_NoticeSth_authorWelfare);
    	//作者板块
    	jb_NoticeSth_authorArea=new JButton("作者板块");
    	jb_NoticeSth_authorArea.setBounds((int)(d.width*0.12)+(int)(d.width*0.07)+
    			(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+
    			(int)(d.width*0.07),-2,(int)(d.width*0.07), 40);
    	jb_NoticeSth_authorArea.setFont(font);
    	jb_NoticeSth_authorArea.setFocusable(false);
    	jb_NoticeSth_authorArea.setCursor(cursor);
//    	jb_NoticeSth_authorArea.setBackground(new Color(0,160,178));
    	jp_NoticeSth_menu.add(jb_NoticeSth_authorArea);
    	//资讯
    	jb_NoticeSth_Notice=new JButton("资讯");
    	jb_NoticeSth_Notice.setBounds((int)(d.width*0.12)+(int)(d.width*0.07)+
    			(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+
    			(int)(d.width*0.07)+(int)(d.width*0.07),-2,(int)(d.width*0.07), 40);
    	jb_NoticeSth_Notice.setFont(font);
    	jb_NoticeSth_Notice.setFocusable(false);
    	jb_NoticeSth_Notice.setCursor(cursor);
//    	jb_NoticeSth_Notice.setBackground(new Color(0,160,178));
    	jb_NoticeSth_Notice.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				JOptionPane.showConfirmDialog(null, "已打开公告界面", "提示",JOptionPane.PLAIN_MESSAGE);
			}
		});
    	jp_NoticeSth_menu.add(jb_NoticeSth_Notice);
    	//wap.客户端
    	jb_NoticeSth_Client=new JButton("wap.客户端");
    	jb_NoticeSth_Client.setBounds((int)(d.width*0.12)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07),-2,(int)(d.width*0.075), 40);
    	jb_NoticeSth_Client.setFont(font);
    	jb_NoticeSth_Client.setFocusable(false);
    	jb_NoticeSth_Client.setCursor(cursor);
//    	jb_NoticeSth_Client.setBackground(new Color(0,160,178));
    	jb_NoticeSth_Client.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
		         try {
		             ////////////////////////---------------------------------- select Look and Feel(下面就是要改变的地方了)
		             JFrame.setDefaultLookAndFeelDecorated(true);
		             UIManager.setLookAndFeel("com.jtattoo.plaf.fast.FastLookAndFeel");
		             ////////////////////////---------------------------------- start application
		             new Wap();
		         }
		         catch (Exception e1) {
		             e1.printStackTrace();
		             
		         }			
			}
		});
    	jp_NoticeSth_menu.add(jb_NoticeSth_Client);
    	//充值
    	jb_NoticeSth_Recharge=new JButton("充值");
    	jb_NoticeSth_Recharge.setBounds((int)(d.width*0.12)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.075),-2,(int)(d.width*0.07), 40);
    	jb_NoticeSth_Recharge.setFont(font);    	
    	jb_NoticeSth_Recharge.setFocusable(false);
    	jb_NoticeSth_Recharge.setCursor(cursor);
//    	jb_NoticeSth_Recharge.setBackground(new Color(0,160,178));
    	jb_NoticeSth_Recharge.setForeground(Color.RED);
    	jp_NoticeSth_menu.add(jb_NoticeSth_Recharge);
        //客服
    	jb_NoticeSth_CustomerService=new JButton("客服");
    	jb_NoticeSth_CustomerService.setBounds((int)(d.width*0.12)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.07)+(int)(d.width*0.075)+(int)(d.width*0.07),-2,(int)(d.width*0.07), 40);
    	jb_NoticeSth_CustomerService.setFont(font);
    	jb_NoticeSth_CustomerService.setFocusable(false);
    	jb_NoticeSth_CustomerService.setCursor(cursor);
//    	jb_NoticeSth_CustomerService.setBackground(new Color(0,160,178));
    	jp_NoticeSth_menu.add(jb_NoticeSth_CustomerService);
    	
    	Font font1=new Font("宋体",Font.PLAIN, 15);
    	//书库
    	jl_NoticeSth_StackRoom=new JLabel("书库");
    	jl_NoticeSth_StackRoom.setBounds((int)(d.width*0.14), (int)(NoticeSthHight*0.55)+3,30, 30);
    	jl_NoticeSth_StackRoom.setFont(font1);
    	jl_NoticeSth_StackRoom.setForeground(Color.white);
    	jl_NoticeSth_StackRoom.setCursor(cursor);
    	jl_NoticeSth_StackRoom.addMouseListener(new MouseAdapter() {
    		@Override
    		public void mouseClicked(MouseEvent e) {
    		JOptionPane.showConfirmDialog(null, "正在打开书库界面", "提示",JOptionPane.PLAIN_MESSAGE);
    			new StackRoom(username,flag);
    			
    		}
		});
    	jp_NoticeNorth_sth.add(jl_NoticeSth_StackRoom);
    	//都市-言情
    	jl_NoticeSth_urbanAndRomance=new JLabel("都市-言情");
    	jl_NoticeSth_urbanAndRomance.setBounds((int)(d.width*0.14)+70, (int)(NoticeSthHight*0.55)+3,80, 30);
    	jl_NoticeSth_urbanAndRomance.setFont(font1);
    	jl_NoticeSth_urbanAndRomance.setForeground(Color.white);
    	jl_NoticeSth_urbanAndRomance.setCursor(cursor);
    	jp_NoticeNorth_sth.add(jl_NoticeSth_urbanAndRomance);
    	//玄幻-修真
    	jl_NoticeSth_fantasy=new JLabel("玄幻-修真");
    	jl_NoticeSth_fantasy.setBounds((int)(d.width*0.14)+70+100, (int)(NoticeSthHight*0.55)+3,80, 30);
    	jl_NoticeSth_fantasy.setFont(font1);
    	jl_NoticeSth_fantasy.setForeground(Color.white);
    	jl_NoticeSth_fantasy.setCursor(cursor);
    	jp_NoticeNorth_sth.add(jl_NoticeSth_fantasy);
    	//历史-武侠
    	jl_NoticeSth_history=new JLabel("历史-武侠");
    	jl_NoticeSth_history.setBounds((int)(d.width*0.14)+70+100+100, (int)(NoticeSthHight*0.55)+3,80, 30);
    	jl_NoticeSth_history.setFont(font1);
    	jl_NoticeSth_history.setForeground(Color.white);
    	jl_NoticeSth_history.setCursor(cursor);
    	jp_NoticeNorth_sth.add(jl_NoticeSth_history);
    	//网游-竞技
    	jl_NoticeSth_sports=new JLabel("网游-竞技");
    	jl_NoticeSth_sports.setBounds((int)(d.width*0.14)+70+100+100+100, (int)(NoticeSthHight*0.55)+3,80, 30);
    	jl_NoticeSth_sports.setFont(font1);
    	jl_NoticeSth_sports.setForeground(Color.white);
    	jl_NoticeSth_sports.setCursor(cursor);
    	jp_NoticeNorth_sth.add(jl_NoticeSth_sports);
    	//军事-科幻
    	jl_NoticeSth_military=new JLabel("军事-科幻");
    	jl_NoticeSth_military.setBounds((int)(d.width*0.14)+70+100+100+100+100, (int)(NoticeSthHight*0.55)+3,80, 30);
    	jl_NoticeSth_military.setFont(font1);
    	jl_NoticeSth_military.setForeground(Color.white);
    	jl_NoticeSth_military.setCursor(cursor);
    	jp_NoticeNorth_sth.add(jl_NoticeSth_military);
    	//恐怖-同人
    	jl_NoticeSth_terror=new JLabel("恐怖-同人");
    	jl_NoticeSth_terror.setBounds((int)(d.width*0.14)+70+100+100+100+100+100, (int)(NoticeSthHight*0.55)+3,80, 30);
    	jl_NoticeSth_terror.setFont(font1);
    	jl_NoticeSth_terror.setForeground(Color.white);
    	jl_NoticeSth_terror.setCursor(cursor);
    	jp_NoticeNorth_sth.add(jl_NoticeSth_terror);
    	//全本-新书
    	jl_NoticeSth_newBook=new JLabel("全本-新书");
    	jl_NoticeSth_newBook.setBounds((int)(d.width*0.14)+70+100+100+100+100+100+100, (int)(NoticeSthHight*0.55)+3,80, 30);
    	jl_NoticeSth_newBook.setFont(font1);
    	jl_NoticeSth_newBook.setForeground(Color.white);
    	jl_NoticeSth_newBook.setCursor(cursor);
    	jp_NoticeNorth_sth.add(jl_NoticeSth_newBook);    	
    }
    //中部
	public void NoticeCenter(Dimension d) {
		Font f=new Font("微软雅黑", Font.PLAIN, 15);		
    	//搜索输入框
		jt_NoticeCenter_search=new JTextField();
		jt_NoticeCenter_search.setBounds((int)(d.width*0.45),(int)(d.height*0.02),(int)(d.width*0.2), 30);
    	jt_NoticeCenter_search.setFont(f);
    	jp_NoticeCenter.add(jt_NoticeCenter_search);
    	//搜索按钮
    	jb_NoticeCenter_search=new JButton("搜  索");
    	jb_NoticeCenter_search.setBounds((int)(d.width*0.68),(int)(d.height*0.02),(int)(d.width*0.06),30);
    	jb_NoticeCenter_search.setBackground(new Color(0,160,178));
    	jb_NoticeCenter_search.setForeground(Color.WHITE);
    	jb_NoticeCenter_search.setFocusable(false);
    	jb_NoticeCenter_search.setFont(f);
    	jp_NoticeCenter.add(jb_NoticeCenter_search);
    	//中部全面板
    	jp_NoticeCenter_total=new JPanel();
    	jp_NoticeCenter_total.setBounds((int)(d.width*0.12),(int)(d.height*0.08),(int)(d.width*0.6), (int)(d.height*1.8));
    	jp_NoticeCenter_total.setBackground(new Color(187,255,255));
    	jp_NoticeCenter_total.setLayout(null);
    	jp_NoticeCenter_total.setBorder(BorderFactory.createEtchedBorder());
    	jp_NoticeCenter_total.add(new JLabel());
    	jp_NoticeCenter.add(jp_NoticeCenter_total);
    	//中部展示面板
    	jp_NoticeCenter_display=new JPanel();
    	jp_NoticeCenter_display.setBounds(1,(int)(d.height*0.04),(int)(d.width*0.598),(int)(d.height*1.6));
    	jp_NoticeCenter_display.setBackground(Color.white);
    	jp_NoticeCenter_display.setLayout(new BorderLayout());
    	jp_NoticeCenter_total.add(jp_NoticeCenter_display);
    	//公告一
    	jl_NoticeCenter_Notice=new JLabel();
    	im_NoticeOne=new ImageIcon(Notice.class.getResource("公告.png"));
    	jl_NoticeCenter_Notice.setIcon(im_NoticeOne);
    	jl_NoticeCenter_Notice.setPreferredSize(new Dimension(0,im_NoticeOne.getIconHeight()));
    	jp_NoticeCenter_display.add(BorderLayout.NORTH,jl_NoticeCenter_Notice);	
    	//切换面板
    	jp_NoticeCenter_change=new JPanel();
    	jp_NoticeCenter_change.setBounds(1,(int)(d.height*1.6),(int)(d.width*0.598),(int)(d.height*0.198));
    	jp_NoticeCenter_change.setBackground(Color.white);
    	jp_NoticeCenter_change.setLayout(null);
    	jp_NoticeCenter_total.add(jp_NoticeCenter_change);
    	//切换==总共信息
    	jl_NoticeCenter_totalMag=new JLabel("总共63条");
    	jl_NoticeCenter_totalMag.setBounds((int)(d.width*0.4),(int)(d.height*0.075),(int)(d.width*0.05),(int)(d.height*0.05));
    	jl_NoticeCenter_totalMag.setFont(f);
    	jp_NoticeCenter_change.add(jl_NoticeCenter_totalMag);
    	//切换===切换按钮一
    	jb_NoticeCenter_changeOne=new JButton("1");
    	jb_NoticeCenter_changeOne.setBounds((int)(d.width*0.45),(int)(d.height*0.08),(int)(d.width*0.025),(int)(d.height*0.04));
    	jb_NoticeCenter_changeOne.setFont(f);
    	jb_NoticeCenter_changeOne.setFocusable(false);
    	jb_NoticeCenter_changeOne.setForeground(Color.white);
    	jb_NoticeCenter_changeOne.setBackground(Color.CYAN);
    	jb_NoticeCenter_changeOne.addActionListener(new ActionListener() {		
			@Override
			public void actionPerformed(ActionEvent e) {
				jp_NoticeCenter_display.removeAll();
		    	im_NoticeOne=new ImageIcon(Notice.class.getResource("公告.png"));
		    	jl_NoticeCenter_Notice.setIcon(im_NoticeOne);
		    	jl_NoticeCenter_Notice.setPreferredSize(new Dimension(0,im_NoticeOne.getIconHeight()));
		    	jp_NoticeCenter_display.add(BorderLayout.NORTH,jl_NoticeCenter_Notice);	
		    	jb_NoticeCenter_changeOne.setForeground(Color.white);
		    	jb_NoticeCenter_changeOne.setBackground(Color.CYAN);
		    	jb_NoticeCenter_changeTwo.setForeground(Color.BLACK);
		    	jb_NoticeCenter_changeTwo.setBackground(Color.white);
		    	jb_NoticeCenter_changeThree.setForeground(Color.BLACK);
		    	jb_NoticeCenter_changeThree.setBackground(Color.white);
		    	jb_NoticeCenter_totalchange.setText("1/3");
		    	jp_NoticeCenter_display.updateUI();
		    	jp_NoticeCenter_display.repaint();		    	
			}
		});
    	jp_NoticeCenter_change.add(jb_NoticeCenter_changeOne);
    	//切换===切换按钮二
    	jb_NoticeCenter_changeTwo=new JButton("2");
    	jb_NoticeCenter_changeTwo.setBounds((int)(d.width*0.475),(int)(d.height*0.08),(int)(d.width*0.025),(int)(d.height*0.04));
    	jb_NoticeCenter_changeTwo.setFont(f);
    	jb_NoticeCenter_changeTwo.setFocusable(false);
    	jb_NoticeCenter_changeTwo.setBackground(Color.WHITE);
    	jb_NoticeCenter_changeTwo.addActionListener(new ActionListener() {		
			@Override
			public void actionPerformed(ActionEvent e) {
				jp_NoticeCenter_display.removeAll();
		    	im_NoticeOne=new ImageIcon(Notice.class.getResource("公告1.png"));
		    	jl_NoticeCenter_Notice.setIcon(im_NoticeOne);
		    	jl_NoticeCenter_Notice.setPreferredSize(new Dimension(0,im_NoticeOne.getIconHeight()));
		    	jp_NoticeCenter_display.add(BorderLayout.NORTH,jl_NoticeCenter_Notice);	
		    	jb_NoticeCenter_changeTwo.setForeground(Color.white);
		    	jb_NoticeCenter_changeTwo.setBackground(Color.CYAN);
		    	jb_NoticeCenter_changeOne.setForeground(Color.BLACK);
		    	jb_NoticeCenter_changeOne.setBackground(Color.white);
		    	jb_NoticeCenter_changeThree.setForeground(Color.BLACK);
		    	jb_NoticeCenter_changeThree.setBackground(Color.white);
		    	jb_NoticeCenter_totalchange.setText("2/3");
		    	jp_NoticeCenter_display.updateUI();
		    	jp_NoticeCenter_display.repaint();		    	
			}
		});
    	jp_NoticeCenter_change.add(jb_NoticeCenter_changeTwo);
    	//切换===切换按钮3
    	jb_NoticeCenter_changeThree=new JButton("3");
    	jb_NoticeCenter_changeThree.setBounds((int)(d.width*0.5),(int)(d.height*0.08),(int)(d.width*0.025),(int)(d.height*0.04));
    	jb_NoticeCenter_changeThree.setFont(f);
    	jb_NoticeCenter_changeThree.setFocusable(false);
    	jb_NoticeCenter_changeThree.setBackground(Color.WHITE);   
    	jb_NoticeCenter_changeThree.addActionListener(new ActionListener() {		
			@Override
			public void actionPerformed(ActionEvent e) {
				jp_NoticeCenter_display.removeAll();
		    	im_NoticeOne=new ImageIcon(Notice.class.getResource("公告3.png"));
		    	jl_NoticeCenter_Notice.setIcon(im_NoticeOne);
		    	jl_NoticeCenter_Notice.setPreferredSize(new Dimension(0,im_NoticeOne.getIconHeight()));
		    	jp_NoticeCenter_display.add(BorderLayout.NORTH,jl_NoticeCenter_Notice);	
		    	jb_NoticeCenter_changeThree.setForeground(Color.white);
		    	jb_NoticeCenter_changeThree.setBackground(Color.CYAN);
		    	jb_NoticeCenter_changeOne.setForeground(Color.BLACK);
		    	jb_NoticeCenter_changeOne.setBackground(Color.white);
		    	jb_NoticeCenter_changeTwo.setForeground(Color.BLACK);
		    	jb_NoticeCenter_changeTwo.setBackground(Color.white);
		    	jb_NoticeCenter_totalchange.setText("3/3");
		    	jp_NoticeCenter_display.updateUI();
		    	jp_NoticeCenter_display.repaint();		    	
			}
		});
    	jp_NoticeCenter_change.add(jb_NoticeCenter_changeThree);
    	//切换===
    	jb_NoticeCenter_totalchange=new JButton("1/3");
    	jb_NoticeCenter_totalchange.setBounds((int)(d.width*0.525),(int)(d.height*0.08),(int)(d.width*0.03),(int)(d.height*0.04));
    	jb_NoticeCenter_totalchange.setFont(f);
    	jb_NoticeCenter_totalchange.setFocusable(false);
    	jb_NoticeCenter_totalchange.setBackground(Color.BLUE); 
    	jb_NoticeCenter_totalchange.setEnabled(false);
    	jp_NoticeCenter_change.add(jb_NoticeCenter_totalchange);
    	
//    	//推荐小说面板
//    	jp_NoticeCenter_Recommend=new JPanel();
//    	jp_NoticeCenter_Recommend.setBounds((int)(d.width*0.73),(int)(d.height*0.08),(int)(d.width*0.2), (int)(d.height*0.5));
//    	jp_NoticeCenter_Recommend.setBackground(Color.white);
//    	jp_NoticeCenter_Recommend.setBorder(BorderFactory.createEtchedBorder());
//    	jp_NoticeCenter_Recommend.add(new JLabel());
//    	jp_NoticeCenter.add(jp_NoticeCenter_Recommend);  	
    }
	
	public static void main(String[] args) {
         try {
             ////////////////////////---------------------------------- select Look and Feel(下面就是要改变的地方了)
             JFrame.setDefaultLookAndFeelDecorated(true);
             UIManager.setLookAndFeel("com.jtattoo.plaf.fast.FastLookAndFeel");
             ////////////////////////---------------------------------- start application
             new Notice("lgw",true);
         }
         catch (Exception e) {
             e.printStackTrace();
             
         }
	}
}
//wap资讯界面
class Wap  extends JFrame{
	private static final long serialVersionUID = 1L;
	private JPanel jp_wap;
	@SuppressWarnings("serial")
	public  Wap() {
		Dimension d = getToolkit().getScreenSize();
		  setLayout(null);
			//主滚动面板
		 JScrollPane js_MainScreen = new JScrollPane();
			js_MainScreen.setBounds(0, 0, d.width, d.height);
			js_MainScreen.getVerticalScrollBar().setUnitIncrement(20);
			add(js_MainScreen);
		ImageIcon im_wap=new ImageIcon(Notice.class.getResource("公告wap.png"));
		jp_wap=new JPanel() {
			@Override
			public void paint(Graphics g) {
			   Image image_wap=im_wap.getImage();
			   g.drawImage(image_wap, 0,0,this);
			}
		};
		int width=(int) d.getWidth();
		int height= (int)d.getHeight();
		jp_wap.setPreferredSize(new Dimension(width,height));
		js_MainScreen.getViewport().add(jp_wap);
		
        setTitle("wap");
		setSize(d);
		setLocationRelativeTo(null);
		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		setVisible(true);	
	}
		
}
